package top.zhuyougu.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import top.zhuyougu.utils.DateUtils;

/**
 * <p>
 * 博客文章表
 * </p>
 *
 * @author 猪油骨
 * @since 2022-12-10 01:15:43
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@TableName("b_article")
@ApiModel(value = "Article对象", description = "博客文章表")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class BlogArticle implements Serializable {

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("用户id")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty("分类id")
    @TableField("category_id")
    private Long categoryId;

    @ApiModelProperty("文章标题")
    @TableField("title")
    private String title;

    @ApiModelProperty("文章封面地址")
    @TableField("avatar")
    private String avatar;

    @ApiModelProperty("文章简介")
    @TableField("summary")
    private String summary;

    @ApiModelProperty("文章内容 （最多两百字）")
    @TableField("content")
    private String content;

    @ApiModelProperty("文章内容md版")
    @TableField("content_md")
    private String contentMd;

    @ApiModelProperty("是否是私密文章 0 否 1是")
    @TableField("is_secret")
    private Integer isSecret;

    @ApiModelProperty("是否置顶 0否 1是")
    @TableField("is_stick")
    private Integer isStick;

    @ApiModelProperty("是否发布 0：下架 1：发布")
    @TableField("is_publish")
    private Integer isPublish;

    @ApiModelProperty("是否原创  0：转载 1:原创")
    @TableField("is_original")
    private Integer isOriginal;

    @ApiModelProperty("转载地址")
    @TableField("original_url")
    private String originalUrl;

    @ApiModelProperty("文章阅读量")
    @TableField("quantity")
    private Long quantity;

    @ApiModelProperty("说明")
    @TableField("remark")
    private String remark;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateUtils.FORMAT_STRING,timezone="GMT+8")
    private Date createTime;

    @ApiModelProperty("seo关键词")
    @TableField("keywords")
    private String keywords;

    @ApiModelProperty("修改时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = DateUtils.FORMAT_STRING,timezone="GMT+8")
    private Date updateTime;


}
